package trans

import (
	"gin-simple/global"
	"github.com/go-playground/validator/v10"
)

func Translate(err error) (errMsg string) {
	errMsg = ""
	errs := err.(validator.ValidationErrors)
	for _, err := range errs {
		errMsg = errMsg + err.Translate(global.Trans) + ","
	}
	return
}
